<?php

/*
 | Cek id apakah ada dalam tabel
 | 
 | Khoiruddin
 | http://khoiruddin.com
 |
 | @access public
 | @param field content
 | @param string - field name
 | @param string - table name
 | @return boolean
 */

function cek_id($id,$field,$table){
    if (empty($id) || empty($table) || empty($table))
    {
      return FALSE;
    }

    $ini = &get_instance();
    $ini->load->database();

    return $ini->db->where($field, $id)
        ->order_by($field, "ASC")
        ->limit(1)
        ->count_all_results($table) > 0;
}